﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GroupShop.Web.Models;
using GroupShop.Model;

namespace GroupShop.Web.Controllers
{
    public class ProductController : Controller
    {
        //
        // GET: /Product/

        public ActionResult Index(int pageIndex)
        {
            if (pageIndex <= 0) pageIndex = 1;
            ProductViewModel product = new ProductViewModel
            {
                Products = new List<ProductModel> 
                {
                    new ProductModel{Id=1, IsNewProduct=true, ProductName="hahhaahha", CurrentPrice=120.01M, Discount=2, OriginalPrice=190},
                    new ProductModel{Id=2, IsNewProduct=true, ProductName="hahhaahha", CurrentPrice=120.01M, Discount=2, OriginalPrice=190},
                    new ProductModel{Id=3, IsNewProduct=true, ProductName="hahhaahha", CurrentPrice=120.01M, Discount=2, OriginalPrice=190},
                    new ProductModel{Id=3, IsNewProduct=false, ProductName="hahhaahha", CurrentPrice=120.01M, Discount=2, OriginalPrice=190},
                },

                Pager = new PagerModel { Index = pageIndex, PageSize = 26, Total = 19 }
            };
            return View(product);
        }

    }
}
